﻿using System;
using System.Collections.Generic;
using Meqs.Entity;

namespace Meqs.Logic.Interface
{
    public interface IMoralityTypeLogic : ICommonLogic<MoralityType, int>
    {
        /// <summary>
        /// 获取所有德育评价大类(小类无大类的算做大类)
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <returns></returns>
        IList<MoralityType> GetAllMoralityType(string schoolMark);

        /// <summary>
        /// 获取所有德育评价大类，与小类无关
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="schoolYear"></param>
        /// <param name="term"></param>
        /// <returns></returns>
        IList<MoralityType> FindAllType(string schoolMark, int schoolYear, int term, int historyID);

        /// <summary>
        /// 获取所有德育评价大类(小类无大类的算做大类)
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="schoolYear"></param>
        /// <param name="term"></param>
        /// <returns></returns>
        IList<MoralityType> GetAllMoralityType(string schoolMark, int schoolYear, int term);

        /// <summary>
        /// 添加类型
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="historyId"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        int InsertType(string schoolMark, int historyId, string typeName);

        /// <summary>
        /// 添加history和type
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="typeName"></param>
        /// <param name="schoolYear"></param>
        /// <param name="term"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        int InsertTypeHistory(string schoolMark, string typeName, int schoolYear, int term, int userId);

        /// <summary>
        /// 验证学年学期下的类型名是否重复
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="schoolYear"></param>
        /// <param name="term"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        int ValidateTypeName(string schoolMark, int schoolYear, int term, string typeName);


        /// <summary>
        /// 删除item和type
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="rid"></param>
        /// <returns></returns>
        int DeleteById(string schoolMark, int rid);


        /// <summary>
        /// 更新类型名
        /// </summary>
        /// <param name="schoolMark"></param>
        /// <param name="rid"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        int UpdateTypeName(string schoolMark, int rid, string typeName);

        IList<MoralityType> GetTypesByKeyWord(string schoolMark, int schoolYear, int term, string keyWord);
    }
}